-
Notifications
You must be signed in to change notification settings - Fork 10
Updated sap_hypervisor_node_preconfigure(redhat_ocpv) #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Updated sap_hypervisor_node_preconfigure(redhat_ocpv) #99
Conversation
bfacbb9
to
95c547c
Compare
- sap_hypervisor_node_preconfigure(redhat_ocpv) - Added assert for kubeconfig - Unified storageclass to sapstorage for both trident and hpp and make configurable - trident: make parameters configurable in role - removed unused create-sap-bridge.yml, label-worker-invtsc.yml, sriov-enabled-unsupported-nics.sh - restructured tasks - added flags for finegranular tasks control, mainly for debugging - add vlan interface support - nmstate: wait for webhooks pods to be available - fix bridge and NAD name for additional bridges - added MCP wait to when installing hostpath provisioner - Storageclass names and default is configurable now - Wait and check for hco-webhook pod - hostpath provisioner: mkfs.xfs in pod, simplified systemd startup scripts
95c547c
to
de09779
Compare
playbooks/vars/sample-variables-sap-hypervisor-redhat-ocp-virt-preconfigure.yml
Show resolved
Hide resolved
playbooks/vars/sample-variables-sap-hypervisor-redhat-ocp-virt-preconfigure.yml
Show resolved
Hide resolved
…cpv_subscription_channel
roles/sap_hypervisor_node_preconfigure/vars/platform_defaults_redhat_ocp_virt.yml
Outdated
Show resolved
Hide resolved
...ap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/worker/setup-worker-nodes.yml
Show resolved
Hide resolved
...ap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/worker/setup-worker-nodes.yml
Outdated
Show resolved
Hide resolved
.../sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/storage/install-trident.yml
Show resolved
Hide resolved
...isor_node_preconfigure/tasks/platform/redhat_ocp_virt/cluster/wait-mcp-finished-updating.yml
Outdated
Show resolved
Hide resolved
annotations: | ||
storageclass.kubernetes.io/is-default-class: "true" | ||
storageclass.kubernetes.io/is-default-class: "{{ 'true' if sap_hypervisor_node_preconfigure_cluster_config.trident.default_storageclass is true else 'false' }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You do not need to check if true
as Ansible has default check.
storageclass.kubernetes.io/is-default-class: "{{ 'true' if sap_hypervisor_node_preconfigure_cluster_config.trident.default_storageclass else 'false' }}"
But it also does not make sense here. default_storageclass
is bool
, so it will always be either true
or false
. So if your issue is with bool vs string, then maybe just check this approach:
storageclass.kubernetes.io/is-default-class: "{{ sap_hypervisor_node_preconfigure_cluster_config.trident.default_storageclass | d('true') | string }}"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your suggested code does render the bool true to the string "True". This is not what is expected, we need the string "true". Hence I've reverted your suggestion and stick to my working code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@newkit I dont use these defaults anymore, because of issues like this, so I always use jinja2, where you can properly validate it and sanitize it, like working example below.
- name: Define required trident keys
ansible.builtin.debug:
msg: "{{ __class if __class is defined and __class is boolean else true }}"
vars:
__class: "{{ sap_hypervisor_node_preconfigure_cluster_config.trident.default_storageclass }}"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the issue with this code?
storageclass.kubernetes.io/is-default-class: "{{ 'true' if sap_hypervisor_node_preconfigure_cluster_config.trident.default_storageclass is true else 'false' }}"
It might not be overly sophisticated but it does what it should and is easy to read.
@newkit Make sure to check ansible-lint and fix issues reported.
|
roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/assert/trident.yml
Outdated
Show resolved
Hide resolved
Linter issues are fixed and deprecated vars are added to initial commit message. |
… it renders to 'True' wheras it has to be set to 'true'
With the latest code all my CI tests are successful now. |
Updated sap_hypervisor_node_preconfigure(redhat_ocpv)
Deprecated vars